package cn.tedu.design;

import org.junit.jupiter.api.Test;

/*本类用来设计老师类 抽象类\
* 面向抽象--后天向上抽取形成的结果*/
public class DesignTeacher {
    @Test
    public void test(){
        Teacher ct=new ACTTeacher();
        ct.ready();
        ct.teach();
        Teacher cgb = new CGBTeacher();
    cgb.teach();
    cgb.ready();
    }
}

/*创建培优老师类*/
abstract class Teacher {
    int id;//工号
    String name;//姓名

    public abstract void ready();

    public abstract void teach();

}
class CGBTeacher extends Teacher{
    @Override
    public void ready() {
        System.out.println("培优老师正在备课电商项目");
    }

    @Override
    public void teach() {
        System.out.println("培优老师正在讲培优项目");
    }
}
class ACTTeacher extends Teacher{
    @Override
    public void ready() {
        System.out.println("正在备课。加强模块");
    }

    @Override
    public void teach() {
        System.out.println("正在讲课");
    }
}
class SCDTeacher extends Teacher{
    @Override
    public void ready() {
        System.out.println("正在备课*******hadoop");
    }

    @Override
    public void teach() {
        System.out.println("正在讲大数据");
    }
};

